/**
 * Generate time : 2011-08-24 17:11:46
 * Version : 1.0.1.V20070717
 */
package com.baosight.sczx.zm.cd.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;

/**
 * ZMCDDirectory
 * 
 */
public class ZMCDDirectory extends DaoEPBase {

	private String fdKeyId = " "; /* 主键 */
	private String fdDirName = " "; /* 目录名称 */
	private String fdSuperDirId = " "; /* 上级目录 */
	private Long fdSerial = new Long(0); /* 序号 */
	private String fdCreatorId = " "; /* 编制人ID */
	private String fdCreator = " "; /* 编制人 */
	private String fdDepartmentId = " "; /* 编制单位ID */
	private String fdDirType = " "; /* 目录属性 */

	private String fdMiningId="";
	/**
	 * initialize the metadata
	 */
	public void initMetaData() {
		EiColumn eiColumn;

		eiColumn = new EiColumn("fdMiningId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("所属矿");
		eiMetadata.addMeta(eiColumn);
		
		eiColumn = new EiColumn("fdKeyId");
		eiColumn.setPrimaryKey(true);
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("主键");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDirName");
		eiColumn.setFieldLength(20);
		eiColumn.setDescName("目录名称");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdSuperDirId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("上级目录");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdSerial");
		eiColumn.setType("N");
		eiColumn.setScaleLength(0);
		eiColumn.setFieldLength(38);
		eiColumn.setDescName("序号");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdCreatorId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("编制人ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdCreator");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("编制人");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDepartmentId");
		eiColumn.setFieldLength(32);
		eiColumn.setDescName("编制单位ID");
		eiMetadata.addMeta(eiColumn);

		eiColumn = new EiColumn("fdDirType");
		eiColumn.setFieldLength(10);
		eiColumn.setDescName("目录属性");
		eiMetadata.addMeta(eiColumn);

	}

	/**
	 * the constructor
	 */
	public ZMCDDirectory() {
		initMetaData();
	}

	public String getFdMiningId() {
		return fdMiningId;
	}

	public void setFdMiningId(String fdMiningId) {
		this.fdMiningId = fdMiningId;
	}

	/**
	 * get the fdKeyId - 主键
	 * 
	 * @return the fdKeyId
	 */
	public String getFdKeyId() {
		return this.fdKeyId;
	}

	/**
	 * set the fdKeyId - 主键
	 */
	public void setFdKeyId(String fdKeyId) {
		this.fdKeyId = fdKeyId;
	}

	/**
	 * get the fdDirName - 目录名称
	 * 
	 * @return the fdDirName
	 */
	public String getFdDirName() {
		return this.fdDirName;
	}

	/**
	 * set the fdDirName - 目录名称
	 */
	public void setFdDirName(String fdDirName) {
		this.fdDirName = fdDirName;
	}

	/**
	 * get the fdSuperDirId - 上级目录
	 * 
	 * @return the fdSuperDirId
	 */
	public String getFdSuperDirId() {
		return this.fdSuperDirId;
	}

	/**
	 * set the fdSuperDirId - 上级目录
	 */
	public void setFdSuperDirId(String fdSuperDirId) {
		this.fdSuperDirId = fdSuperDirId;
	}

	/**
	 * get the fdSerial - 序号
	 * 
	 * @return the fdSerial
	 */
	public Long getFdSerial() {
		return this.fdSerial;
	}

	/**
	 * set the fdSerial - 序号
	 */
	public void setFdSerial(Long fdSerial) {
		this.fdSerial = fdSerial;
	}

	/**
	 * get the fdCreatorId - 编制人ID
	 * 
	 * @return the fdCreatorId
	 */
	public String getFdCreatorId() {
		return this.fdCreatorId;
	}

	/**
	 * set the fdCreatorId - 编制人ID
	 */
	public void setFdCreatorId(String fdCreatorId) {
		this.fdCreatorId = fdCreatorId;
	}

	/**
	 * get the fdCreatorId - 编制人
	 * 
	 * @return the fdCreatorId
	 */
	public String getFdCreator() {
		return this.fdCreator;
	}

	/**
	 * set the fdCreatorId - 编制人
	 */
	public void setFdCreator(String fdCreator) {
		this.fdCreator = fdCreator;
	}

	/**
	 * get the fdDepartmentId - 编制单位ID
	 * 
	 * @return the fdDepartmentId
	 */
	public String getFdDepartmentId() {
		return this.fdDepartmentId;
	}

	/**
	 * set the fdDepartmentId - 编制单位ID
	 */
	public void setFdDepartmentId(String fdDepartmentId) {
		this.fdDepartmentId = fdDepartmentId;
	}

	/**
	 * get the fdDirType - 目录属性
	 * 
	 * @return the fdDirType
	 */
	public String getFdDirType() {
		return this.fdDirType;
	}

	/**
	 * set the fdDirType - 目录属性
	 */
	public void setFdDirType(String fdDirType) {
		this.fdDirType = fdDirType;
	}

	/**
	 * get the value from Map
	 */
	@SuppressWarnings("rawtypes")
	public void fromMap(Map map) {

		setFdMiningId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdMiningId")), fdMiningId));
		setFdKeyId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdKeyId")), fdKeyId));
		setFdDirName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDirName")), fdDirName));
		setFdSuperDirId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdSuperDirId")), fdSuperDirId));
		setFdSerial(NumberUtils.toLong(StringUtils.toString(map.get("fdSerial")), fdSerial));
		setFdCreatorId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdCreatorId")), fdCreatorId));
		setFdCreator(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdCreator")), fdCreator));
		setFdDepartmentId(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDepartmentId")), fdDepartmentId));
		setFdDirType(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDirType")), fdDirType));

	}

	/**
	 * set the value to Map
	 */
	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map toMap() {

		Map map = new HashMap();
		map.put("fdMiningId", StringUtils.toString(fdMiningId, eiMetadata.getMeta("fdMiningId")));
		map.put("fdKeyId", StringUtils.toString(fdKeyId, eiMetadata.getMeta("fdKeyId")));
		map.put("fdDirName", StringUtils.toString(fdDirName, eiMetadata.getMeta("fdDirName")));
		map.put("fdSuperDirId", StringUtils.toString(fdSuperDirId, eiMetadata.getMeta("fdSuperDirId")));
		map.put("fdSerial", StringUtils.toString(fdSerial, eiMetadata.getMeta("fdSerial")));
		map.put("fdCreatorId", StringUtils.toString(fdCreatorId, eiMetadata.getMeta("fdCreatorId")));
		map.put("fdCreator", StringUtils.toString(fdCreator, eiMetadata.getMeta("fdCreator")));
		map.put("fdDepartmentId", StringUtils.toString(fdDepartmentId, eiMetadata.getMeta("fdDepartmentId")));
		map.put("fdDirType", StringUtils.toString(fdDirType, eiMetadata.getMeta("fdDirType")));

		return map;

	}
}